﻿@model MvcUI.Models.ListUserViewModel

@{
    Layout = null;
}

<script language="javascript" type="text/javascript">
    function RefreshJsBox5(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            navTabPageBreak({ pageNum: "1", numPerPage: "20", orderField: "Name", orderDirection: "asc" }, "jbsxBox5")
            if ("closeCurrent" == json.callbackType) {
                setTimeout(function () { $.pdialog.closeCurrent(); }, 100);
            } else if ("forward" == json.callbackType) {
                dialog.reload(json.forwardUrl);
            }
        }
    }
  
</script>
<div class="pageHeader" style="border: 1px #B8D0D6 solid">
    @using (Html.BeginForm("Users", "MUserRole", FormMethod.Post, new { id = "pagerForm", onsubmit = "return divSearch(this, 'jbsxBox4');" }))
    {
        <input type="hidden" name="pageNum" value="@Model.PagingInfo.CurrentPage" />
        <input type="hidden" name="numPerPage" value="@Model.PagingInfo.ItemsPerPage" />
        <input type="hidden" name="orderField" value="@Model.PagingInfo.OrderField" />
        <input type="hidden" name="orderDirection" value="@Model.PagingInfo.OrderDirection" />
    }
    <div class="pageHeader">
        @using (Html.BeginForm("Users", "MUserRole", FormMethod.Post, new { rel = "pagerForm", onsubmit = "return divSearch(this,'jbsxBox5');" }))
        {
            <div class="searchBar">
                <table class="searchContent">
                    <tr>
                        <td>
                            
                                角色名：<b style=" color:Red;">@ViewData["Name"]</b>
                            
                        </td>
                        <td>
                           
                                用户名:
                            <input type="text" name="keywords" value="@Model.KeyWord" />
                        </td>
                        <td>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="submit">
                                        检索</button></div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        }
    </div>
</div>
<div class="pageContent" style="border-left: 1px #B8D0D6 solid; border-right: 1px #B8D0D6 solid">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a title="确实要移除这些用户吗?" target="selectedTodo" rel="ids5" href="@Url.Action("RemoveUsersBatch", "MUserRole")" class="delete" callback="RefreshJsBox5">
                <span>批量移除</span></a></li>
        </ul>
    </div>
    <table class="table" layoutH="165" rel="jbsxBox5">
        <thead>
            <tr>
                <th width="40">
                    <input type="checkbox" group="ids5" class="checkboxCtrl">
                </th>
                <th width="90" orderfield="UserName" class="@Model.PagingInfo.OrderDirection">
                    用户名
                </th>
                <th width="150">
                    电话号码
                </th>
                <th width="70">
                    邮箱
                </th>
                <th width="150">
                    是否可用
                </th>
                <th width="40">
                    移除
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var s in Model.Users)
            { 
                <tr target="sid_user" rel="@s.ID">
                    <td>
                        <input name="ids5" value="@s.ID" type="checkbox">
                    </td>
                    <td>@s.UserName
                    </td>
                    <td>@s.Phone
                    </td>
                    <td>@s.Email
                    </td>
                    <td>@s.Enabled
                    </td>
                    <td>
                        <a title="删除" target="ajaxTodo" href="@Url.Action("DeleteByUserID", "MUserRole", new { id = @s.ID })" class="btnDel" callback="RefreshJsBox5">
                            删除</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>每页显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'jbsxBox5')">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <span>条，共
                @Model.PagingInfo.TotalItems
                条</span>
        </div>
        <div class="pagination" rel="jbsxBox5" totalcount="@Model.PagingInfo.TotalItems" numperpage="@Model.PagingInfo.ItemsPerPage" pagenumshown="8"
            currentpage="@Model.PagingInfo.CurrentPage">
        </div>
    </div>
</div>


